package com.yidu.t299.controller.twj;

import com.yidu.t299.domain.chr.Class;
import com.yidu.t299.domain.chr.Lesson;
import com.yidu.t299.domain.fxj.ClassRoom;
import com.yidu.t299.domain.fxj.ClassS;
import com.yidu.t299.domain.fxj.LessonDomain;
import com.yidu.t299.domain.ssk.School;
import com.yidu.t299.domain.twj.SysRight;
import com.yidu.t299.domain.xp.StudentManage;
import com.yidu.t299.domain.zzy.Record;
import com.yidu.t299.domain.zzy.TeacherRemark;
import com.yidu.t299.service.chr.*;
import com.yidu.t299.service.fxj.SyllabussBiz;
import com.yidu.t299.service.ssk.ChargeBiz;
import com.yidu.t299.service.ssk.StuReturnMoneyBiz;
import com.yidu.t299.service.twj.SysRightBiz;
import com.yidu.t299.service.xp.*;
import com.yidu.t299.service.zzy.ClasssBiz;
import com.yidu.t299.service.zzy.LessonaBiz;
import com.yidu.t299.service.zzy.RecordaBiz;
import com.yidu.t299.service.zzy.TeacherRemarkBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * @author twj
 * 页面跳转的控制器
 * @version 1.0.0
 */
@Controller
public class SystemController {
    @Autowired
    private SysRightBiz sysRightBiz;


    /* twj */
    @GetMapping("sysRight/nb")
    @ResponseBody
    public List<SysRight> nb(){
        return sysRightBiz.findMenu(1);
    }

    @RequestMapping("page/index")
    public String index(){
        return "twj/index";
    }

    @RequestMapping("page/login")
    public String login(){
        return "twj/login";
    }

    @RequestMapping("page/welcome")
    public String welcome(){
        return "twj/welcome";
    }

    @RequestMapping("page/right")
    public String SysRight(){
        return "twj/SysRightCRUD";
    }

    @RequestMapping("page/user")
    public String SysUser(){
        return "twj/SysUserCRUD";
    }

    @RequestMapping("page/role")
    public String SysRole(){
        return "twj/SysRoleCRUD";
    }

    /*  lzy -- 合作伙伴/市场计划/来源方式 */
    @RequestMapping("page/cooperateCRUD")
    public String cooperateCRUD(){
        return "lzy/cooperateCRUD";
    }
    @RequestMapping("page/marketCRUD")
    public String marketCRUD(){
        return "lzy/marketCRUD";
    }
    @RequestMapping("page/sourcesettingCRUD")
    public String sourcesettingCRUD(){
        return "lzy/sourcesettingCRUD";
    }

    /* ssk -- 账户/惩罚/退费/收费/优惠/活动/绩效/员工/学生退费 */
    @Autowired
    private ChargeBiz chargeBiz;
    @Autowired
    private StuReturnMoneyBiz stuReturnMoneyBiz;

    @RequestMapping("page/accountCRUD")
    public String account(){
        return "ssk/accountCRUD";
    }
    @RequestMapping("page/awardpenalizeCRUD")
    public String awardpenalizeCRUD(){
        return "ssk/awardpenalizeCRUD";
    }
    @RequestMapping("page/ChargeBacktrackCRUD")
    public String ChargeBacktrackCRUD(){
        return "ssk/ChargeBacktrack";
    }
    @RequestMapping("page/chargeCRUD")
    public ModelAndView chargeCRUD(){
        List<School> schoolList = chargeBiz.selectAllGetSchool();//得到所有校区信息
        ModelAndView mv = new ModelAndView();
        mv.setViewName("ssk/chargeCRUD");//跳转的页面
        mv.addObject("schoolList",schoolList); //保存校区信息
        return mv;
    }
    @RequestMapping("page/marketsCRUD")
    public String marketsCRUD(){
        return "ssk/marketCRUD";
    }

    @RequestMapping("page/PerformanceStatCRUD")
    public String PerformanceStatCRUD(){
        return "ssk/PerformanceStatCRUD";
    }

    @RequestMapping("page/ChargeFormulaeCRUD")
    public ModelAndView ChargeFormulaeCRUD(){
        List<School> schoolList = stuReturnMoneyBiz.selectAllGetSchool();//得到所有校区信息
        ModelAndView mv = new ModelAndView();
        mv.setViewName("ssk/StuReturnMoneyCRUD");//跳转的页面
        mv.addObject("schoolList",schoolList); //保存校区信息
        return mv;
    }

    /* cfj -- 员工/变动记录/部门/职位/考勤 */
    @RequestMapping("page/recordCRUD")
    public String recordCRUD(){
        return "cfj/recordCRUD";
    }

    @RequestMapping("page/changeannalCRUD")
    public String changeannalCRUD(){
        return "cfj/changeannalCRUD";
    }

    @RequestMapping("page/deptCRUD")
    public String deptCRUD(){
        return "cfj/deptCRUD";
    }

    @RequestMapping("page/jobCRUD")
    public String jobCRUD(){
        return "cfj/jobCRUD";
    }

    @RequestMapping("page/timeclockCRUD")
    public String timeclockCRUD(){
        return "cfj/timeclockCRUD";
    }


    /* chr -- 学员成绩/学员单科总成绩/学员单科成绩/成绩分析图 */
    @Autowired
    private GradesBiz gradesBiz;
    @Autowired
    private GradeBiz gradeBiz;
    @Autowired
    private LessonBiz lessonBiz;
    @Autowired
    private StudentManageBiz studentManageBiz;
    @Autowired
    private SchoolBiz schoolBiz;
    @Autowired
    private ClassBiz classBiz;
    @Autowired
    private GradessBiz gradessBiz;


    @RequestMapping("page/allgrade")
    public ModelAndView allgrade(){
        List<Lesson> lessonsList = lessonBiz.selectAll();//得到所有课程信息
        List<com.yidu.t299.domain.chr.School> schoolList = schoolBiz.selectAll();//得到所有校区信息
        ModelAndView mv = new ModelAndView();
        mv.setViewName("chr/allgrade");//跳转的页面
        mv.addObject("lessonsList",lessonsList); //保存课程信息
        mv.addObject("schoolList",schoolList); //保存校区信息
        return mv;
    }
    @RequestMapping("page/sumgrade")
    public ModelAndView sumgrade(){
        List<Class> classList = classBiz.selectAll();
        ModelAndView mv = new ModelAndView();
        mv.setViewName("chr/sumgrade");//跳转的页面
        mv.addObject("classList",classList);
        return mv;
    }
    @RequestMapping("page/sortgrade")
    public ModelAndView sortgrade(){
        List<Class> classList = classBiz.selectAll();
        List<Lesson> lessonsList = lessonBiz.selectAll();//得到所有课程信息
        List<com.yidu.t299.domain.chr.School> schoolList = schoolBiz.selectAll();//得到所有校区信息
        ModelAndView mv = new ModelAndView();
        mv.setViewName("chr/sortgrade");//跳转的页面
        mv.addObject("classList",classList);
        mv.addObject("lessonsList",lessonsList); //保存课程信息
        mv.addObject("schoolList",schoolList); //保存校区信息
        return mv;
    }
    @RequestMapping("page/gradeChat")
    public String gradeChat(){
        return "chr/gradeChat";
    }


    /* ljc -- 物品盘点/物品库存/物品入库/物品库存预警/物资管理/教材出库/教材入库/物品出库 */
    @RequestMapping("page/goodscheckCRUD")
    public String goodscheckCRUD(){
        return "ljc/goodscheckCRUD";
    }

    @RequestMapping("page/goodstockCRUD")
    public String goodstockCRUD(){
        return "ljc/goodstockCRUD";
    }

    @RequestMapping("page/instoreroomCRUD")
    public String instoreroomCRUD(){
        return "ljc/instoreroomCRUD";
    }

    @RequestMapping("page/itemCRUD")
    public String itemCRUD(){
        return "ljc/itemCRUD";
    }

    @RequestMapping("page/materialCRUD")
    public String materialCRUD(){
        return "ljc/materialCRUD";
    }

    @RequestMapping("page/outstockcopyCRUD")
    public String outstockcopyCRUD(){
        return "ljc/outstockcopyCRUD";
    }

    @RequestMapping("page/stockcopyCRUD")
    public String stockcopyCRUD(){
        return "ljc/stockcopyCRUD";
    }

    @RequestMapping("page/storeroomCRUD")
    public String storeroomCRUD(){
        return "ljc/storeroomCRUD";
    }


    /* ssk -- 收费统计/班级情况统计/招生统计/财务和收费统计/市场统计/学员数量 */
    @RequestMapping("page/charge")
    public String charge(){
        return "ssk/fx/Charge";
    }

    @RequestMapping("page/classs")
    public String classs(){
        return "ssk/fx/Class";
    }
    @RequestMapping("page/enroll")
    public String enroll(){
        return "ssk/fx/Enroll";
    }
    @RequestMapping("page/finance")
    public String finance(){
        return "ssk/fx/Finance";
    }
    @RequestMapping("page/maket")
    public String maket(){
        return "ssk/fx/Maket";
    }
    @RequestMapping("page/student")
    public String student(){
        return "ssk/fx/Student";
    }

    /* zzy -- 班级日志/备课表/课程表/教学主管/查看课程进度 */
    @Autowired
    private ClasssBiz classsBiz;
    @Autowired
    private LessonaBiz lessonsBiz;
    @Autowired
    private TeacherRemarkBiz teacherRemarkBiz;
    @Autowired
    private RecordaBiz recordBiz;


    @RequestMapping("page/classLogCRUD")
    public ModelAndView classLogCRUD(){
        List<com.yidu.t299.domain.zzy.Class> classList = classsBiz.selectAllGetClass();//得到所有课程信息
        ModelAndView mv = new ModelAndView();
        mv.setViewName("zzy/classLogCRUD");//跳转的页面
        mv.addObject("classList",classList); //保存课程信息
        return mv;
    }

    @RequestMapping("page/syllabusCRUD")
    public String syllabusCRUD(){
        return "zzy/syllabusCRUD";
    }

    @RequestMapping("page/teacherRemarkCRUD")
    public ModelAndView teacherRemarkCRUD(){
        List<Record> recordList = recordBiz.selectAllGetRecord();//得到所有课程信息
        ModelAndView mv = new ModelAndView();
        mv.setViewName("zzy/teacherRemarkCRUD");//跳转的页面
        mv.addObject("recordList",recordList); //保存课程信息
        return mv;
    }

    @RequestMapping("page/teacherRemarkTwoCRUD")
    public String teacherRemarkTwoCRUD(){
        return "zzy/teacherRemarkTwoCRUD";
    }

    @RequestMapping("page/lessonCRUD")
    public ModelAndView lessonCRUD(){
        List<com.yidu.t299.domain.zzy.Lesson> lessonList = lessonsBiz.selectAllGetLessons();//得到所有课程信息
        List<com.yidu.t299.domain.zzy.Class> classList = classsBiz.selectAllGetClass();//得到所有课程信息
        List<TeacherRemark> teacherRemarkList = teacherRemarkBiz.selectAllGetTeacherRemark();//得到所有课程信息
        ModelAndView mv = new ModelAndView();
        mv.setViewName("zzy/lessonCRUD");//跳转的页面
        mv.addObject("lessonList",lessonList); //保存课程信息
        mv.addObject("classList",classList); //保存课程信息
        mv.addObject("teacherRemarkList",teacherRemarkList); //保存课程信息
        return mv;
    }

    /* xp -- 报班 */
    @Autowired
    private ClassManageBiz classManageBiz;
    @Autowired
    private LatencyenrolPaneIBiz latencyenrolPaneIBiz;
    @Autowired
    private LogManageBiz logManageBiz;
    @Autowired
    private SedulousManageBiz sedulousManageBiz;
    @Autowired
    private StucatabolizeManageBiz stucatabolizeManageBiz;
    @Autowired
    private StudentChangeBiz studentChangeBiz;
    @Autowired
    private StudentManagebBiz studentManagebBiz;

    @RequestMapping("page/classManage")
    public ModelAndView classManage(){
        List<com.yidu.t299.domain.xp.Class> classList = classManageBiz.selectAllGetClass();//得到所有课程名称
        List<com.yidu.t299.domain.xp.School> schoolList = classManageBiz.selectAllGetSchool();//得到所有校区名称
        List<StudentManage> studentManageList = classManageBiz.selectAllGetStudent();//得到所有学员姓名
        ModelAndView mv = new ModelAndView();
        mv.setViewName("xp/classManage");//跳转的页面
        mv.addObject("classList",classList); //保存课程信息
        mv.addObject("schoolList",schoolList); //保存校区信息
        mv.addObject("studentManageList",studentManageList); //保存学员信息
        return mv;
    }
    @RequestMapping("page/latencyenrolpanel")
    public ModelAndView latencyenrolpanel(){
        List<com.yidu.t299.domain.xp.Record> studentManageListOne = latencyenrolPaneIBiz.selectAllGetRecordName();//得到所有教师姓名
        List<com.yidu.t299.domain.xp.School> studentManageListTwo = latencyenrolPaneIBiz.selectAllGetSchoolName();//得到所有校区名称
        List<com.yidu.t299.domain.xp.Class> studentManageListThree = latencyenrolPaneIBiz.selectAllGetClassName();//得到所有班级名称
        ModelAndView mv = new ModelAndView();
        mv.setViewName("xp/latencyenrolpanel");//跳转的页面
        mv.addObject("studentManageListOne",studentManageListOne); //保存校区信息
        mv.addObject("studentManageListTwo",studentManageListTwo); //保存校区信息
        mv.addObject("studentManageListThree",studentManageListThree); //保存班级信息
        return mv;
    }
    @RequestMapping("page/logManage")
    public ModelAndView logManage(){
        List<StudentManage> studentManageList = logManageBiz.selectAllGetStudent();//得到所有学员姓名
        ModelAndView mv = new ModelAndView();
        mv.setViewName("xp/logManage");//跳转的页面
        mv.addObject("studentManageList",studentManageList); //保存学员信息
        return mv;
    }
    @RequestMapping("page/sedulousManage")
    public ModelAndView sedulousManage(){
        List<StudentManage> studentManageList = sedulousManageBiz.selectAllGetStudent();//得到所有学员姓名
        List<com.yidu.t299.domain.xp.Lesson> lessonList = sedulousManageBiz.selectAllGetlessonName();//得到所有课程
        ModelAndView mv = new ModelAndView();
        mv.setViewName("xp/sedulousManage");//跳转的页面
        mv.addObject("studentManageList",studentManageList); //保存学员信息
        mv.addObject("lessonList",lessonList); //保存课程信息
        return mv;
    }
    @RequestMapping("page/stucatabolizeManage")
    public ModelAndView stucatabolizeManage(){
        List<com.yidu.t299.domain.xp.School> studentManageListOne = stucatabolizeManageBiz.selectAllGetSchoolName();//得到所有校区名称
        List<com.yidu.t299.domain.xp.Class> studentManageListTwo = stucatabolizeManageBiz.selectAllGetClassName();//得到所有班级名称
        List<com.yidu.t299.domain.xp.Record> studentManageListThird = stucatabolizeManageBiz.selectAllGetRecordName();//得到所有教师名称
        ModelAndView mv = new ModelAndView();
        mv.setViewName("xp/stucatabolizeManage");//跳转的页面
        mv.addObject("studentManageListOne", studentManageListOne); //保存校区信息
        mv.addObject("studentManageListTwo", studentManageListTwo); //保存班级信息
        mv.addObject("studentManageListThird", studentManageListThird); //保存教师信息
        return mv;
    }
    @RequestMapping("page/studentChange")
    public ModelAndView studentChange(){
        List<com.yidu.t299.domain.xp.Record> studentChangeListOne = studentChangeBiz.selectAllGetRecordName();//得到所有教师名称
        List<com.yidu.t299.domain.xp.Class> studentChangeListTwo = studentChangeBiz.selectAllGetClassName();//得到所有班级名称
        List<com.yidu.t299.domain.xp.School> studentChangeListThird  = studentChangeBiz.selectAllGetSchoolName();//得到所有校区名称
        ModelAndView mv = new ModelAndView();
        mv.setViewName("xp/studentChange");//跳转的页面
        mv.addObject("studentChangeListOne",studentChangeListOne); //保存教师信息
        mv.addObject("studentChangeListTwo",studentChangeListTwo); //保存班级信息
        mv.addObject("studentChangeListThird",studentChangeListThird); //保存校区信息
        return mv;
    }
    @RequestMapping("page/studentManage")
    public ModelAndView studentManage(){
        List<com.yidu.t299.domain.xp.School> studentManageListTwo = studentManagebBiz.selectAllGetSchoolName();//得到所有校区名称
        List<com.yidu.t299.domain.xp.Class> studentManageListThree = studentManagebBiz.selectAllGetClassName();//得到所有班级名称
        List<com.yidu.t299.domain.xp.Record> studentManageListFourth = studentManagebBiz.selectAllGetRecordName();//得到所有教师名称
        ModelAndView mv = new ModelAndView();
        mv.setViewName("xp/studentManage");//跳转的页面
        mv.addObject("studentManageListTwo",studentManageListTwo); //保存校区信息
        mv.addObject("studentManageListThree",studentManageListThree); //保存班级信息
        mv.addObject("studentManageListFourth",studentManageListFourth); //保存教师信息
        return mv;
    }

    /* fxj -- 教室/开班/安排课程/课程/课程表 */
    @RequestMapping("page/classb")
    public String classb(){
        return "fxj/classCRUD";
    }

    @RequestMapping("page/classRoom")
    public String classRoom(){
        return "fxj/classRoomCRUD";
    }

    @RequestMapping("page/lesson")
    public String lesson(){
        return "fxj/lessonCRUD";
    }

    @Autowired
    public SyllabussBiz syllabusBiz;

    @RequestMapping("page/syllabus")
    public ModelAndView syllabus(){
        // 查找教室
        List<ClassRoom> list = syllabusBiz.classroom();
        // 查找班级
        List<ClassS> classList = syllabusBiz.classSelect();
        // 查找老师
        List<com.yidu.t299.domain.fxj.Record> teacher = syllabusBiz.teacher();
        // 查找科目
        List<LessonDomain> lesson = syllabusBiz.lesson();
        ModelAndView mv = new ModelAndView();
        mv.setViewName("fxj/syllabusCRUD");// 跳转的页面
        mv.addObject("classroomList", list);// 教室
        mv.addObject("classList", classList);// 班级
        mv.addObject("teacherList", teacher);// 老师
        mv.addObject("lessonList", lesson);// 科目
        return mv;
    }

    @RequestMapping("page/syllabusTable")
    public String syllabusTable(){
        return "fxj/syllabusTable";
    }

}
